﻿@{
    //IEnumerable<BarSection> barSections = ViewData.Get<IEnumerable<BarSection>>("barSections", new List<BarSection>());
    //long userThreadCount = ViewData.Get<long>("userThreadCount", 0);
    //long userPostCount = ViewData.Get<long>("userPostCount", 0);
    //long userFollowSectionCount = ViewData.Get<long>("userFollowSectionCount", 0);
    User user = ViewData.Get<User>("user", null);
    IUser currentUser = UserContext.CurrentUser;

}
<div class="tn-box tn-widget tn-widget-content tn-corner-all spb-story-user-panel-box">
    <div class="tn-box-content tn-widget-content tn-corner-all">
        <div class="spb-story-user-panel">
            <div class="tn-card">
                <div class="tn-user-info tn-helper-clearfix">
                    <div class="tn-avatar">@Html.ShowUserAvatar(user.UserId, AvatarSizeType.Small, true)</div>
                    <div class="tn-info">
                        <p class="tn-user-name"><a href="@SiteUrls.Instance().CmsUser(user.UserId)"><strong>@user.DisplayName</strong></a></p>
                        <p class="tn-user-data">
                            @if (user.Profile != null)
                            {
                                if (user.Profile.Gender == GenderType.Male)
                                { 
                                @Html.Icon(IconTypes.Male, "男")
                                }
                                else if (user.Profile.Gender == GenderType.FeMale)
                                { 
                                @Html.Icon(IconTypes.Female, "女")
                                }
                                <span class="tn-location">@Formatter.FormatArea(user.Profile.NowAreaCode)</span>
                            }
                        </p>
                    </div>
                </div>
                <div class="tn-actions">
                    @if (currentUser != null && currentUser.UserId != user.UserId)
                        {  
                            @Html.FollowUser(user.UserId, "收藏")                                                      
                            <a href="@SiteUrls.Instance()._CreateMessage(currentUser.UserName, toUserId: user.UserId)" class="tn-button tn-corner-all tn-button-secondary tn-button-hollow tn-button-text-icon-primary" plugin = "dialog" title="私信">
                                <span class="tn-icon tn-icon-email"></span><span class="tn-button-text">私信</span></a>                                        
                        }
                </div>
            </div>
               @Html.Action("_HisContribute", "ChannelCms", new { userId = user.UserId })
        </div>
    </div>
</div>
